/** \file    BuildProfilesImpl.h
  * \brief   All nested loops of BuildProfiles and most processor time is located here.
  * \date    2001 - 2003
  * \author  Fedor Chelnokov
  * \version $Header: /home/cscom1r4/cvsroot/cs/segm/src/BuildProfilesImpl.h,v 1.1 2004/05/20 09:11:46 cscom1r4 Exp $
  */

#ifndef _BuildProfilesImpl_h_
#define _BuildProfilesImpl_h_

#include "imglib/convert.h"
#include "segm/Segmentation.h"

///////////////////////////
// internal declarations //
///////////////////////////

void buildProfileInternal( 
	Distinction distinction,
	LimitativeFunc limitativeFunc,
	Segmentation &s, 
	const img::FImage &src, const img::FImage &tgt, 
	int size,
	bool activeOnly = false
);

/////////////////////////
// public declarations //
/////////////////////////

///only internal pixels
inline void buildProfileInternal( 
	Segmentation & s, 
	const float_image & src, 
	const float_image & tgt, 
	const ProfileParams & param,
	bool activeOnly = false
) {
	img::FImage xsrc, xtgt;
	img::share_data(xsrc, src);
	img::share_data(xtgt, tgt);
	buildProfileInternal(param.distinction, param.limitativeFunc, 
		s, xsrc, xtgt, param.maxDisplacement, activeOnly);
}

#endif //_BuildProfilesImpl_h_
